fix(lint): resolve all ruff violations blocking CI - #7
Draft
Sbussiso wants to merge 1 commit into
Draft
Conversation
CI run #20 failed because 'ruff check src/ tests/' reported 97 violations. This commit fixes all of them: - E501 (52): wrapped long lines to <=120 chars — string concatenation, parenthesized expressions, multi-line dict/call formatting - RUF001 (17): replaced cosmetic en-dashes in histogram bucket labels with ASCII hyphens; added noqa comments for intentional Unicode (mojibake test data, CJK regex ranges, sentence-ender sets) - F401 (1): PatternTimeout was a re-export, not unused — added to __all__ - SIM103 (2): collapsed if/return True/return False into direct return - SIM102 (1): collapsed nested if into a single if-with-and - RUF012 (2): mutable list class defaults to tuples in test mock classes - RUF015 (2): list-comprehension-first-element to next() generator - RUF059 (2): renamed unused unpacked vars to underscore-prefixed - E741 (2): ambiguous single-letter 'l' to 'line' in test comprehensions - I001/E401/F541/W292/RUF022: auto-fixed by 'ruff check --fix' All 1694 tests pass. Ruff 0.15.22 (locked version) reports clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI Failure Triage — Run #20 (31567271618)
Root cause:
ruff check src/ tests/reported 97 lint violations, failing the CI lint step before tests could run.Violations fixed (97 total):
noqafor intentional Unicode (mojibake test data, CJK regex, sentence-enders)PatternTimeoutwas a re-export — added to__all__if/return True/return False→ direct returnif→ singleif a and b[x for ...][0]→next(x for ...)_-prefixedl→lineruff check --fixVerification:
ruff check src/ tests/— All checks passed (ruff 0.15.22, the locked version)pytest tests/— 1694 passed, 0 failedScope: Purely stylistic/structural changes. No logic changes. All test data strings preserved exactly (string concatenation produces identical values).